var sOrden = "-"

function ordenar(oXml,sCampo)
{
	var oXmlAux = oXml.cloneNode(true);
	var xsl = new ActiveXObject("Microsoft.XMLDOM")
	
try{
	if (sOrden == "+") sOrden = "-"
	else sOrden = "+"
    
     //alert(GenerarXSL(oXmlAux,sCampo,sOrden))
     
    xsl.loadXML(GenerarXSL(oXmlAux,sCampo,sOrden))
    
    oXmlAux.documentElement.transformNodeToObject(xsl.documentElement,eval(oXml).XMLDocument);
    
    //xmlDatos.loadXML(oXml.xml)
   }
catch(e)
{
	alert("Error al ordenar la tabla de datos.\n" + e.description)
	
}  
    
}

function ordenarCorte(sCampo){
	
	
	if (sOrden == "+") sOrden = "-"
	else sOrden = "+"
    
    var xsl = new ActiveXObject("Microsoft.XMLDOM")
    xsl.loadXML(GenerarXSLCorte(xmldoc,sCampo,sOrden))
    xmldoc.documentElement.transformNodeToObject(xsl.documentElement, xmldso.XMLDocument);
   
}


function MasAdelante(sTabla){
	eval("window.document.all." + sTabla + ".lastPage()")
}

function MasAtras(sTabla){
	eval("window.document.all." + sTabla + ".firstPage()")
}

function Atras(sTabla){
	eval("window.document.all." + sTabla + ".previousPage()")
}

function Adelante(sTabla){
	eval("window.document.all." + sTabla + ".nextPage()")
}		

function Refrescar(tabla){
	if (window.event.keyCode == 13){
		if (window.document.all.txtPageSize.value > 0)
		{
			eval("window.document.all." + tabla + ".dataPageSize = parseInt(window.document.all.txtPageSize.value)")
			eval("window.document.all." + tabla + ".refresh()")
			
		}
		
	}

}

function Refrescar2(tabla, txtCampo){
	if (window.event.keyCode == 13){
		if (eval("window.document.all." + txtCampo + ".value") > 0 ){
			eval("window.document.all." + tabla + ".dataPageSize = parseInt( " + eval("window.document.all." + txtCampo + ".value") + ")")
			eval("window.document.all." + tabla + ".refresh()")
		}
		
	}

}

function NewConsul(iSize)
{
	window.document.all.tblDatos.dataPageSize = iSize
}